package filetest.test01;

import java.io.File;
import java.util.Scanner;

public class Test04 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        System.out.println("请输入一个文件名");
        String  name = scanner.next();
        File dir = new File(name);

        if (dir.isDirectory()){
            dir.delete();
            System.out.println("删除成功");
        }else {
            System.out.println("文件不存在");
        }

    }
}
